{extend name="base/common"}

{block name="style"}
<style>
    .shadow{width: 100%;height: 120%;position: absolute;left: 0;top: 0;background: rgba(0,0,0,0.4);z-index: 88;}
    input[name='jg'],input[name='xt'],input[name='my']{width:40px;text-align: center;margin:0 10px;}
    input[name='up'],input[name='float'],input[name='low'],input[name='work'],input[name='style'],input[name='area'],input[name='twin'],input[name='three'],input[name='develop'],input[name='other'] {width:40px;text-align: center;margin:0 10px;}
    .minus,.add,.add1,.add2 b,.add4 b,.add5 b,.add6 b,.add7 b, .add8 b , .add9 b{cursor: pointer;display: inline-block;
        width: 20px;
        text-align: center;}
    .table tr th,.table tr td{
        text-align: center;
    }
    .table tr th:nth-child(2),.table tr td:nth-child(2){
        text-align: left;
    }
</style>

{/block}

{block name="page-header"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>评价管理</h2>
        <ol class="breadcrumb">
            <li>
                <a href="{:Url('Evaluate/index')}">老师列表</a>
            </li>
            <li class="active">
                <strong>评价列表</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">
    </div>
</div>
{/block}

{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 style="color: green">*注：点击可查看评价内容以及对应的课表</h5>
                    <div class="ibox-tools">
                        <select name="score" style="width: 10%;height: 25px" onchange="changeType()">
                            {empty name="score"}
                            <option value="0" selected >全部</option>
                            <option value="1" >1 分</option>
                            <option value="2" >2 分</option>
                            <option value="3" >3 分</option>
                            <option value="4" >4 分</option>
                            <option value="5" >5 分</option>
                            {else/}
                            <option value="0" {eq name="$score" value="0"}selected {/eq} >全部</option>
                            <option value="1" {eq name="$score" value="1"}selected {/eq} >1 分</option>
                            <option value="2" {eq name="$score" value="2"}selected {/eq}>2 分</option>
                            <option value="3" {eq name="$score" value="3"}selected {/eq}>3 分</option>
                            <option value="4" {eq name="$score" value="4"}selected {/eq}>4 分</option>
                            <option value="5" {eq name="$score" value="5"}selected {/eq}>5 分</option>
                            {/empty}
                        </select>
                        <a href="{:Url('Evaluate/index')}" class="btn btn-white btn-sm"><i class="fa fa-reply"></i> 返回</a>
                    </div>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="table-responsive">
                        <div  style="padding-right:17px">
                            <table class="table table-striped">
                                <tr>
                                    <th width="10%">姓名</th>
                                    <th width="30%">学校</th>
                                    <th width="10%">评价分数</th>
                                    <th width="20%">评价时间</th>
                                    <th width="30%">操作</th>
                                </tr>
                            </table>
                        </div>
                        <div style="width:100%;height:500px;overflow:auto; border-bottom:1px solid #dddddd">
                            <table class="table table-striped">
                                <tbody>
                                {volist name="list" id="vo"}
                                <tr>
                                    <td width="10%">{$vo.openid|get_name=###,1}</td>
                                    <td width="30%">{$vo.openid|get_name=###,2}</td>
                                    <td width="10%">{$vo.score}</td>
                                    <td width="20%">{$vo.create_time|time_format='Y-m-d H:i'}</td>
                                    <td width="30%">
                                        <a href="javascript:showIframe({$vo.id})">评价详情</a>&emsp;
                                        <a href="{:Url('Course/scan?id='.$vo['c_id'])}">对应课表</a>&emsp;
                                        <a href="{:Url('Evaluate/del?id='.$vo['id'])}" class="confirm ajax-del">删除</a>
                                    </td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </div>
                        <tfoot>
                        <tr>
                            <td colspan="10">
                            </td>
                        </tr>
                        </tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<iframe id="iframe" src="" style="height: 80%;width: 600px;z-index: 99;position: absolute;top: 15%;border: 0;left: 32%;background: #fff;display: none;" scrolling="auto" seamless></iframe>
<div class="shadow" style="display: none"></div>
{/block}

{block name="script"}
<script src="__ADMIN__/js/plugins/iCheck/icheck.min.js"></script>
<script>
    highlight_subnav("{:Url('Evaluate/index')}");
    $(document).ready(function(){
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });
    function changeType(){
        var id ="{$id}";
        var score = $("select[name='score']").val();
        location.href = "/DDDeducation/public/index.php/admin/Evaluate/sign/id/"+id+"/score/"+score;
    }
    function showIframe(myid){
        var iframe = $("#iframe");
        var url = "/DDDeducation/public/index.php/admin/Evaluate/preview/id/" + myid;
        iframe.attr("src",url);
        iframe.show();
        $(".shadow").show();
        $(".wrapper").css("z-index",0);
        close(iframe);
    }
    function close(ele){
        $(".shadow").on('click',function(){
            $(this).hide();
            ele.hide();
        });
    }
</script>
{/block}